package com.jiangjiang.eshop.schedule.builder;

import com.jiangjiang.eshop.order.dto.OrderInfoDTO;
import com.jiangjiang.eshop.order.dto.OrderItemDTO;
import com.jiangjiang.eshop.wms.dto.SaleDeliveryOrderDTO;

import java.util.List;

/**
 * @ClassName SaleDeliveryOrderBuilder
 * @Description 销售出库单构造器接口
 * @Author jhw
 * @Date 2021/7/24 18:07
 * @Version 1.0
 **/
public interface SaleDeliveryOrderBuilder {

    /**
     * 为销售出库单设置订单相关的数据
     *
     * @param order 销售订单
     * @return 销售出库builder
     * @throws Exception
     */
    SaleDeliveryOrderBuilder setOrderRelatedData(OrderInfoDTO order) throws Exception;

    /**
     * 创建销售出库单条目数据
     *
     * @param items 销售单明细数据
     * @return 销售出库单builder
     * @throws Exception
     */
    SaleDeliveryOrderBuilder createSaleDeliveryOrderItems(List<OrderItemDTO> items) throws Exception;

    /**
     * 创建发货单
     * @param order 销售订单
     * @return 销售出库单 builder
     * @throws Exception
     */
    SaleDeliveryOrderBuilder createSendOutOrder(OrderInfoDTO order) throws Exception;

    /**
     * 创建物流单
     * @return 销售出库单 builder
     * @throws Exception
     */
    SaleDeliveryOrderBuilder createLogisticOrder(OrderInfoDTO order) throws Exception;

    /**
     * 初始化销售出库单的状态
     * @return 销售出库单 builder
     * @throws Exception
     */
    SaleDeliveryOrderBuilder initStatus() throws Exception;

    /**
     * 初始化时间相关的字段
     * @return 销售出库单builder
     * @throws Exception
     */
    SaleDeliveryOrderBuilder initTimes() throws Exception;

    /**
     * 创建最终构造好的销售出库单
     * @return 销售出库单
     * @throws Exception
     */
    SaleDeliveryOrderDTO create() throws Exception;


}
